package tests;

import static org.junit.Assert.*;
import mt.Order;
import mt.comm.ServerMsg;
import mt.comm.ServerSideMessage.Type;

import org.junit.Before;
import org.junit.Test;

public class ServerMsgTest {
	private ServerMsg drogba;
	private Order order;
	private String error;
	
	@Before
	public void setUp() throws Exception {
		error = "sem erro";
		order.createBuyOrder("toino", "world of warcraft",10,30);
	}

	@Test
	public void testStart() {
		drogba = new ServerMsg(Type.NEW_ORDER, order, error);
	}

	@Test
	public void testSendOrder() {
		drogba = new ServerMsg(Type.NEW_ORDER, order, error);
		assertEquals(drogba.getOrder(), order);
	}

	@Test
	public void testSendError() {
		drogba = new ServerMsg(Type.NEW_ORDER, order, error);
		assertEquals(drogba.getOrder(), order);
	}



}
